<template>
    <div class="backstage_by">
        <div class="register">
            <div class="steps">
                <el-steps :active="active" align-center active-color="#13ce66" process-status="finish">
                    <el-step title="CPLC注册"></el-step>
                    <el-step title="CAIO注册"></el-step>
                    <el-step title="CDIO注册"></el-step>
                    <el-step title="端口寄存器映射"></el-step>
                </el-steps>
            </div>
            <Cplc v-if="active === 0"></Cplc>
            <Caio v-else-if="active === 1"></Caio>
            <Cdio v-else-if="active === 2"></Cdio>
            <Port v-else></Port>
            <div class="button">
                <el-button v-if="active !== 3" type="primary" @click="next">下一步</el-button>
                <el-button v-if="active === 3" type="primary" @click="next">同步到中控器</el-button>
            </div>

        </div>
    </div>
</template>
<script>
import Cplc from './register/cplc.vue'
import Caio from './register/caio.vue'
import Cdio from './register/cdio.vue'
import Port from './register/port.vue'
// import { register } from '@/api/information'
export default {
    name: "Register",
    data() {
        return {

            active: 0,

        };
    },

    components: { Cplc, Caio, Cdio, Port },
    methods: {

        // 下一步
        next() {
            if (this.active++ > 2) this.active = 0;
            console.log(this.active)
        }
    },
};
</script>
    
<style lang="scss" scoped>
.backstage_by {
    // background-color: #3768FA;
    width: 100%;
    height: 100%;
    background-color: #F0F3FA;
}

.register {
    width: calc(100% - 30px);
    height: calc(100vh - 130px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;


    .steps {
        background-color: white;
        border-radius: 4px;
        margin-top: 15px;

        .el-steps {
            padding: 20px;
        }
    }

    .button {
        position: fixed;
        bottom: 0;
        width: 100%;
        margin-left: -15px;
        height: 50px;
        background-color: white;
        border-top: 1px solid #e5e5e5;
        display: flex;
        align-items: center;
        justify-content: center;
    }

}
</style>
      